package mt.comm.implement;

import java.io.Serializable;

import mt.Order;

/**
 * Messages sent from clients to the server. A message contains a type (enum), the nickname of the sender (String), 
 * and, depending on the message type, a new order. 
 * <p>
 * 
 * @author alc
 */

public class  ServerSideMessageImp implements ServerSideMessage,Serializable{
	private Type type;
	private String senderNickname;
	private Order order;

	public ServerSideMessageImp(Type type, String senderNickname, Order order) {
		this.type = type;
		this.senderNickname = senderNickname;
		this.order = order;
	}

	@Override
	public Type getType() {
		return type;
	}

	@Override
	public String getSenderNickname() {
		return senderNickname;
	}

	@Override
	public Order getOrder() {
		return order;
	}
}
	